Ext.onReady(function(){
    var processHistoryPanel=Ext.create('component.proces.history',{
        processInstanceId: procInstId,
        minHeight:100,
        colspan:2,
		 contextPath:contextPath
   });
   processHistoryPanel.setAutidStatusName(auditStatus);
   processHistoryPanel.setProcesHistoryVisible(processFlag);
	var fileAttachment = Ext.create('component.file.attachment',{
        objectId: businessAbnormaId,
        imageType: "6",
        contextPath:contextPath,
        colspan:2
   });
	   var fromPanelInfo = Ext.create('Ext.form.FormPanel',{
		    renderTo:Ext.getBody(),
		    titleAlign:'center',
	        title:'退房审批单',
		    border: true,
		    layout:{
		    	 type: 'table',
                 columns: 2,
                 tableAttrs: {　　//在这儿控制table标签中的Attrs属性
                     border: 1,
                     cellpadding: 5,
                     cellspacing: 1,
                     width: '95%',
                     align: 'center',
                     style: "border:1px solid gray;border-collapse:collapse;margin:0 auto;text-align:center;"
                 },
                 tdAttrs: {　　//控制td标签的属性，以上用法都是在ext的api中查到，同样的方式可以给tr添加属性
                     width: '100px',
                     height: '40px',
                     style: "padding:5px",
                     valign: 'middle'
                 }
		    },
			 items:[{
				    xtype:'displayfield',
				    fieldLabel: '合同编号',
				    name: 'signCode'
				},{
				    xtype:'displayfield',
				    fieldLabel: '签约总价(元)',
				    name: 'signAmount'
				},{
				    xtype:'displayfield',
				    fieldLabel: '房号',
				    name: 'roomName'
				},{
				    xtype:'displayfield',
				    fieldLabel: '客户姓名',
				    name: 'customerName'
				},{
				    xtype:'displayfield',
				    fieldLabel: '签约日期',
				    name: 'didTime'
				},{
				    xtype:'displayfield',
				    fieldLabel: '签约明细',
				    name:'signedDetail'
				   
				},{
				    xtype:'displayfield',
				    fieldLabel: '退房原因',
				    name: 'remark',
				    width:900,
				    align: 'left',
				    id:'reason',
				    colspan:2
				},{
					 xtype:'displayfield',
					 fieldLabel: '已收定金',
					 hidden:specialFlowFlag,
					 name:'subscribeAmount'
				},{
					 xtype:'displayfield',
					 fieldLabel: '已收房款',
					 hidden:specialFlowFlag,
					 name:'haveCollection'
				},{
					 xtype:'displayfield',
					 fieldLabel: '没收违约金',
					 hidden:specialFlowFlag,
					 name:'liquidat'
				},{
					 xtype:'displayfield',
					 fieldLabel: '退款金额',
					 hidden:specialFlowFlag,
					 name:'sigLiquidat'
				},{
				    xtype:'displayfield',
				    fieldLabel: '经纪人',
				    name: 'userName'
				},{
				    xtype:'displayfield',
				    fieldLabel: '申请日期',
				    name: 'tcCreateTime'
				},processHistoryPanel,fileAttachment],
				dockedItems: [{
		            xtype: 'toolbar',
		            dock: 'bottom',
		            ui: 'footer',
		            layout: {
		                pack: 'center'
		            },
		            items: [
		            {
						xtype: "button",
						text : "返回",
						id: "btn_back",
						name: "btn_back",
						hidden:hiddenBtn,
						icon : contextPath + '/resources/ExtJSicons/shape_move_backwards.png',
						listeners: {
							click: function(){
								history.go(-1);
							}
						}
					}]
		        }
		        ]
	   });
	   
	   fromPanelInfo.getForm().load({
			url:contextPath+'/customer/signed/loadCheckOutInfo',
			params:{'signedId':signedId,businessAbnormaId:businessAbnormaId},
			success:function(form, action){
				var obj = action.result.data;
				var result=Ext.JSON.decode(obj);
				fromPanelInfo.getForm().setValues(result);
				var showUrl = contextPath+"/customer/signed/toView?id="+signedId+"&returnUrl=,marketing,pin,index&processFlag=processHistoryShow";
				var showHerf = "<a href="+showUrl+" target='_blank'>签约明细</a>";
				fromPanelInfo.getForm().findField("signedDetail").setValue(showHerf);
			},   
			failure: function(form, action) {
		        Ext.Msg.alert("加载失败", action.result.errorMessage);
		    }
		});
	  
});